﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace SimpleNoteLib.Json
{
    internal class JsonBase
    {
        public static T FromString<T>(string json)
        {
            T result = JsonConvert.DeserializeObject<T>(json);
            return result;
        }

        protected string ToJsonString()
        {
            string result = JsonConvert.SerializeObject(this);
            return result;
        }

        public override string ToString()
        {
            return ToJsonString();
        }
    }
}
